package com.clss.commandhelper.function.login;

import android.content.Context;

import com.clss.commandhelper.base.BaseJson;
import com.clss.commandhelper.base.BaseModel;
import com.clss.commandhelper.net.ApiClient;

import java.util.HashMap;
import java.util.Map;

import retrofit2.Callback;


/**
 *
 * @author liuv
 * @date 2017/11/6
 */

public class LoginModel extends BaseModel {
    private static final String TAG = "LoginModel";

    public LoginModel(Context context) {
        super(context);
    }

    public void toLogin(String username, String password,
                        Callback<BaseJson> callback){
        Map<String, String> body = new HashMap<>(5);
        body.put("userName", username);
        body.put("password", password);

        mCall = ApiClient.apiList.login(body);
        mCall.enqueue(callback);
    }
}
